# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gpaste
pkgver=42.1
pkgrel=0
pkgdesc="Clipboard managment system"
url="https://github.com/Keruspe/GPaste"
arch="all !s390x !riscv64" # limited by gnome-control-center
license="BSD-2-Clause"
makedepends="
	appstream-glib-dev
	dbus-dev
	gjs-dev
	gnome-control-center-dev
	gtk+3.0-dev
	libadwaita-dev
	meson
	mutter-dev
	vala
	"
subpackages="
	$pkgname-dev
	$pkgname-lang
	$pkgname-doc
	$pkgname-gnome:_gnome:noarch
	$pkgname-bash-completion:bashcomp
	$pkgname-zsh-completion:zshcomp
	"
source="gpaste-$pkgver.tar.gz::https://github.com/Keruspe/GPaste/archive/v$pkgver.tar.gz"
builddir="$srcdir/GPaste-$pkgver"

build() {
	abuild-meson \
		-Dsystemd=false \
		-Dintrospection=true \
		-Dvapi=true \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

_gnome() {
	install_if="$pkgname=$pkgver-r$pkgrel gnome-shell gnome-control-center"
	depends="gnome-control-center"
	mkdir -p "$subpkgdir"/usr/share
	mv "$pkgdir"/usr/share/gnome-shell \
		"$pkgdir"/usr/share/gnome-control-center \
		"$subpkgdir"/usr/share
}

sha512sums="
e3f51da55b53e03758450bee967a9f23908c06db71cf687f6de000efb4715263e25020028d488797d8e1f75154f2f00c59b3a427f1aeca5d0132ac927060047e  gpaste-42.1.tar.gz
"
